<%= form_for(@car) do |f| %>
  <% if @car.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@car.errors.count, "error") %> prohibited this car from being saved:</h2>

      <ul>
      <% @car.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :registration_number %><br />
    <%= f.text_field :registration_number %>
  </div>
  <div class="field">
    <%= f.label :engine_type %><br />
    <%= f.select(:engine_type, options_for_select([['Petrol', 1], ['Diesel', 2]], @car.engine_type)) %>
  </div>
  <div class="field">
    <%= f.label :gearbox_type %><br />
    <%= f.select(:gearbox_type, options_for_select([['Manual', 1], ['Automatic', 2]], @car.gearbox_type)) %>
  </div>
  <div class="field">
    <%= f.label :manufacturer %><br />
    <%= f.text_field :manufacturer %>
  </div>
  <div class="field">
    <%= f.label :model %><br />
    <%= f.text_field :model %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>
